/*
 * @Description:用户中心模块
 * @Author: 小雨
 * @Date: 2024-07-04 17:24:29
 * @LastEditTime: 2024-07-05 15:35:16
 * @LastEditors: 小雨
 */
const express = require('express');
const db = require('../db/index');
//导入验证数据的中间件
const expressJoi = require('@escook/express-joi');
const { update_password_schema, delete_schema, update_userinfo_schema } = require('../shema/user');

const router = express.Router();
const userinfo_handler = require('../router_handler/userinfo');

router.get('/userinfo', userinfo_handler.getUserInfo);

router.post('/userinfo', expressJoi(update_userinfo_schema), userinfo_handler.updateUserInfo);

router.post('/updatepwd', expressJoi(update_password_schema), userinfo_handler.updatepwd);

router.get('/deletecate/:id', expressJoi(delete_schema), userinfo_handler.deletecate);

module.exports = router;
